package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entiry.Comment;
import cn.tedu._04mybatis.pojo.vo.CommentVO1;
import cn.tedu._04mybatis.pojo.vo.CommentVO2;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper {
    //@Insert(value = "insert into comment (content,created,user_id,weibo_id) \
    // values (#{content},#{created},#{user_id},#{weibo_id})")
    int insertComment(Comment comment);
    //@Delete(value = "delete from comment where id = #{cid}")
    int deleteById(Long cid);
    //@Select(value = "select content,user_id,weibo_id  from comment where id = #{cid}")
    List<CommentVO1> selectCommentById1(Long cid);
    //@Select(value = "select content,user_id from comment where weibo_id=#{wid}")
    List<CommentVO2> selectCommentById2(Long wid);
}
